package com.ucode.cgms.service.impl;

import com.ucode.cgms.mapper.CgmsSpecialZoneMapper;
import com.ucode.cgms.service.CgmsSpecialZoneService;
import com.ucode.model.cgms.CgmsSpecialZone;
import com.ucode.tool.base.enums.CommonSwitchStatusEnum;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;

@Service
public class CgmsSpecialZoneServiceImpl implements CgmsSpecialZoneService {

    @Resource
    private CgmsSpecialZoneMapper cgmsSpecialZoneMapper;

    @Override
    public CgmsSpecialZoneMapper initMapper() {
        return cgmsSpecialZoneMapper;
    }

    @Override
    public int updateStatus(Collection<Long> ids, Integer status) {
        return cgmsSpecialZoneMapper.updateStatus(ids, status);
    }

    @Override
    public List<CgmsSpecialZone> queryListByEnable() {
        Map<String,Object> condition = new HashMap<>();
        condition.put("status", CommonSwitchStatusEnum.ENABLE.getCode());
        condition.put("deltag",false);
        return this.queryObjectForList(condition,0);
    }

}
